home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 138
/
Volume 138 Aug 19 2011 - Damaged.iso
/
Games
/
shadez.swf
/
scripts
/
Local
/
Math
/
CRandom.as
next >
Wrap
Text File
|
2011-08-19
|
2KB
|
104 lines
package Local.Math
{
public class CRandom
{
private static const MULTIPLIER:uint = 16807;
private static const dMODULUS:Number = 1 / 2147483647;
private static const MODULUS:uint = 2147483647;
private var _Seed:uint;
public function CRandom(param1:uint)
{
if(true)
{
super();
mSeed = param1;
}
}
public function OffsetAndAdd(param1:Number, param2:Number) : Number
{
if(true)
{
§§push(Offset(param1));
§§push(Offset(param1));
if(true)
{
var _loc3_:* = §§pop();
if(true)
{
param1 = §§pop();
§§push(_loc3_);
}
return §§pop() < 0 ? Number(param1 - param2) : Number(param1 + param2);
}
§§goto(addr47);
}
§§goto(addr33);
}
public function Num() : Number
{
return mSeed * dMODULUS;
}
public function SignOrZero() : int
{
return int(Num() * 3) - 1;
}
public function UINT(param1:uint) : uint
{
return mSeed % param1;
}
public function Offset(param1:Number) : Number
{
§§push(Num());
if(true)
{
§§push(§§pop() * 2);
if(true)
{
§§push(§§pop() * param1);
}
§§push(§§pop() - param1);
}
return §§pop();
}
public function set mSeed(param1:uint) : void
{
§§push(§§findproperty(_Seed));
if(true)
{
§§pop()._Seed = !!param1 ? uint(param1) : uint(MODULUS - 1);
return;
}
§§goto(addr14);
}
public function Sign() : int
{
return int(Num() * 2) * 2 - 1;
}
public function get mSeed() : uint
{
§§push(§§findproperty(mSeed));
§§push(_Seed * MULTIPLIER);
if(true)
{
§§push(§§pop() % MODULUS);
}
§§pop().mSeed = §§pop();
return _Seed;
}
}
}